package com.stylefeng.guns.modular.revenue.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.stylefeng.guns.core.util.DateUtil;
import com.stylefeng.guns.modular.revenue.model.Revenue;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 盈亏报表管理接口
 */

public interface RevenueMapper extends BaseMapper<Revenue> {
    /**
     * 按平台和时间查询盈亏报表
     * @param platform
     * @param beginDate
     * @param endDate
     * @return
     */
    List<Map<String,Object>> selectRevenue (@Param("platform") String platform, @Param("beginDate")  String beginDate, @Param("endDate")  String endDate);

    /**
     * 批量添加盈亏报表
     * @param revenues
     * @return
     */
    int addRevenues(List<Revenue> revenues);

    /**
     * 添加盈亏报表
     * @param revenue
     * @return
     */
    int addRevenue(Revenue revenue);

    int updateRevenue(Revenue revenue);

    Revenue getViewPfr(@Param("platform") String platform,@Param("revtime")  Date revtime);

    /**
     * 按时间段查询盈亏
     * @param platform
     * @param beginDate
     * @return
     */

    Revenue getRevenuesByDate(@Param("platform") String platform,@Param("beginDate") Date beginDate,@Param("endDate")Date endDate);
}
